/* enum */
import ComponentNameEnum from '@model/enum/ComponentNameEnum'
/* model */
import {
  SettingGPTQuestionTypeEnum, 
  SettingGPTRobotSettingTypeCNNmaeEnum, 
  SettingGPTRobotSettingTypeEnum
} from '@src/modules/setting/gpt/model'
/* vue */
import { defineComponent, PropType } from 'vue'

enum SettingGPTEditViewTabsEventEnum {
  Input = 'input'
}

export default defineComponent({
  name: ComponentNameEnum.SettingGPTEditViewTabs,
  props: {
    value: {
      type: String as PropType<SettingGPTRobotSettingTypeEnum>,
      default: SettingGPTRobotSettingTypeEnum.PrivateModel
    },
    onInput: {
      type: Function
    }
  },
  data() {
    return {
      currentTab: this.value
    }
  },
  methods: {
    onTabChangeHandler(tab: SettingGPTQuestionTypeEnum) {
      this.$emit(SettingGPTEditViewTabsEventEnum.Input, tab)
    }
  },
  render() {
    return (
      <div class={ComponentNameEnum.SettingGPTEditViewTabs}>
        
        <el-tabs
          value={this.value}
          onInput={this.onTabChangeHandler}
        >
          
          {/* start 专属模型 */}
          <el-tab-pane 
            label={SettingGPTRobotSettingTypeCNNmaeEnum[SettingGPTRobotSettingTypeEnum.PrivateModel]}
            name={SettingGPTRobotSettingTypeEnum.PrivateModel}
          >
          </el-tab-pane>
          {/* end 专属模型 */}
          
          {/* start 公共模型 */}
          <el-tab-pane 
            label={SettingGPTRobotSettingTypeCNNmaeEnum[SettingGPTRobotSettingTypeEnum.PublicModel]}
            name={SettingGPTRobotSettingTypeEnum.PublicModel}
          >
          </el-tab-pane>
          {/* end 公共模型 */}
          
        </el-tabs>
        
      </div>
    )
  }
})